-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrent scan init sample #19177
Concurrent scan init sample #19177
Conversation
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 121c77c1909fc10b3e76940a4c36d46bee6a0111 more detailssdk-nrf:
Github labels
List of changed files detected by CI (9)
Outputs:ToolchainVersion: b77d8c1312 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
|
||
|config| | ||
|
||
Configuration options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this section unless you have some sample-specific new Kconfig options that are not available in the Kconfig reference. The one here is already available.
@@ -0,0 +1,238 @@ | |||
.. _bt_scanning_while_connecting: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably buried too deep in the structure. Suggesting to leave out the central
folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To illustrate how connection establishment speed can be improved, it measures the time needed to connect to 16 devices with three different modes: sequential scanning and connection establishment, concurrent scanning while connecting, and concurrent scanning while connecting with the filter accept list. | ||
It will connect to any device that matches the device name set with :kconfig:option:`CONFIG_BT_DEVICE_NAME`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To illustrate how connection establishment speed can be improved, it measures the time needed to connect to 16 devices with three different modes: sequential scanning and connection establishment, concurrent scanning while connecting, and concurrent scanning while connecting with the filter accept list. | |
It will connect to any device that matches the device name set with :kconfig:option:`CONFIG_BT_DEVICE_NAME`. | |
To illustrate how connection establishment speed can be improved, it measures the time needed to connect to 16 devices with three different modes: | |
* Sequential scanning and connection establishment | |
* Concurrent scanning while connecting | |
* Concurrent scanning while connecting with the filter accept list | |
It will connect to any device that matches the device name set with the :kconfig:option:`CONFIG_BT_DEVICE_NAME` Kconfig option. |
It (ín two places) referring here to the sample?
.. table-from-sample-yaml:: | ||
|
||
The sample also requires at least one other development kit running a sample advertising with the name set with :kconfig:option:`CONFIG_BT_DEVICE_NAME`. | ||
It is recommended to use the sample :ref:`peripheral_uart`, because this sample acts as multiple peripheral devices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is recommended to use the sample :ref:`peripheral_uart`, because this sample acts as multiple peripheral devices. | |
It is recommended to use the :ref:`peripheral_uart` sample, because this sample acts as multiple peripheral devices. |
================================================ | ||
|
||
This is the slowest and simplest approach. | ||
Sequential scanning and connection establishment is therefore recommended when the application only needs to connect a handful of devices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sequential scanning and connection establishment is therefore recommended when the application only needs to connect a handful of devices. | |
Sequential scanning and connection establishment is recommended when the application only needs to connect a handful of devices. |
Concurrent scanning while connecting | ||
==================================== | ||
|
||
This mode requires the application to enable :kconfig:option:`CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mode requires the application to enable :kconfig:option:`CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL`. | |
This mode requires the application to enable the :kconfig:option:`CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL` Kconfig option. |
==================================== | ||
|
||
This mode requires the application to enable :kconfig:option:`CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL`. | ||
In this mode the scanner is not stopped when the application creates connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this mode the scanner is not stopped when the application creates connections. | |
In this mode, the scanner is not stopped when the application creates connections. |
Concurrent scanning while connecting with the filter accept list | ||
================================================================ | ||
|
||
This mode requires the application to enable :kconfig:option:`CONFIG_BT_FILTER_ACCEPT_LIST` in addition to :kconfig:option:`CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mode requires the application to enable :kconfig:option:`CONFIG_BT_FILTER_ACCEPT_LIST` in addition to :kconfig:option:`CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL`. | |
This mode requires the application to enable the :kconfig:option:`CONFIG_BT_FILTER_ACCEPT_LIST` Kconfig option in addition to :kconfig:option:`CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL`. |
|
||
.. note:: | ||
This sample application assumes it will never have to cache more devices than the maximum number of addresses that can be stored in the filter accept list. | ||
For applications that cannot adhere to this simplification, the function :cfunc:`cache_peer_address` can be changed to not store more than :kconfig:option:`CONFIG_BT_CTLR_FAL_SIZE`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For applications that cannot adhere to this simplification, the function :cfunc:`cache_peer_address` can be changed to not store more than :kconfig:option:`CONFIG_BT_CTLR_FAL_SIZE`. | |
For applications that cannot adhere to this simplification, the function :cfunc:`cache_peer_address` can be changed to not store more than defined by the :kconfig:option:`CONFIG_BT_CTLR_FAL_SIZE` Kconfig option. |
ef7b520
to
d38bea7
Compare
d38bea7
to
e4e3a24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments. Otherwise the sample is ready
integration_platforms: | ||
- nrf52840dk/nrf52840 | ||
- nrf5340dk/nrf5340/cpuapp | ||
- nrf54l15dk/nrf54l15/cpuapp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add nrf54l15dk/nrf54l10/cpuapp
and nrf54l15dk/nrf54l05/cpuapp
as well?
LOG_ERR("Failed to stop scanning (err %d)", err); | ||
} | ||
LOG_DBG("Stopped scanning"); | ||
LOG_INF("Stopped scanning"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed
LOG_INF("Stopped scanning"); |
return 0; | ||
} | ||
|
||
sdc_hci_cmd_vs_central_acl_event_spacing_set_t event_spacing_params = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdc_hci_cmd_vs_central_acl_event_spacing_set_t event_spacing_params = { | |
/* Set a small spacing between central links to leave more time for scanning. */ | |
sdc_hci_cmd_vs_central_acl_event_spacing_set_t event_spacing_params = { |
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(connection_establishment_benchmark) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this?
project(connection_establishment_benchmark) | |
project(scanning_while_connecting) |
e4e3a24
to
941381f
Compare
941381f
to
ce79f80
Compare
355ade8
to
01cf1b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember the changelog entry!
|
||
.. note:: | ||
This sample application assumes it will never have to cache more devices than the maximum number of addresses that can be stored in the filter accept list. | ||
For applications that cannot adhere to this simplification, the function :cfunc:`cache_peer_address` can be changed to not store more than defined by the :kconfig:option:`CONFIG_BT_CTLR_FAL_SIZE` Kconfig option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For applications that cannot adhere to this simplification, the function :cfunc:`cache_peer_address` can be changed to not store more than defined by the :kconfig:option:`CONFIG_BT_CTLR_FAL_SIZE` Kconfig option. | |
For applications that cannot adhere to this simplification, the function :c:func:`cache_peer_address` can be changed to not store more than defined by the :kconfig:option:`CONFIG_BT_CTLR_FAL_SIZE` Kconfig option. |
the missing colon also gave a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know if something in the changelog entry I added should be changed.
01cf1b8
to
e2b60e9
Compare
doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
Outdated
Show resolved
Hide resolved
a09ec01
to
235061e
Compare
c0e38cd
to
1cfafcb
Compare
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publish GitHub Action. |
1cfafcb
to
1144d8c
Compare
Add sample application that demonstrates faster connection establishment using CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL. Signed-off-by: Henrik Lander <[email protected]>
1144d8c
to
121c77c
Compare
@nrfconnect/ncs-co-build-system @nrfconnect/ncs-dragoon-doc @nrfconnect/ncs-code-owners can you have a look at this PR? |
No description provided.